﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Web;
using DHQGHN.DAL;
using DHQGHN.DAL.Models.Online;
using DHQGHN.DAL.Models.TDT;
using DHQGHN.DAL.ModelsUpload;

namespace DHQGHN.Services.TDT
{
    [ServiceContract]
    public interface IHouseHoldService
    {
        /// <summary>
        /// phunx1, 20150514: ham get HouseHold theo ID
        /// </summary>
        /// <param name="houseHoldID"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByID/{houseHoldID}"
            )]
        HOUSEHOLD2 GetByID(string houseHoldID);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="eaCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAllByEACode/{eaCode}")]
        IEnumerable<HOUSEHOLD> GetAllByEACode(string eaCode);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="eaCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAllByEACodePaging/{eaCode}/{pageSize}/{pageIdx}")]
        IEnumerable<HOUSEHOLD> GetAllByEACodePaging(string eaCode, string pageSize, string pageIdx);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAllByUserName/{UserName}")]
        List<HouseDetail> GetAllByUserName(string UserName);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="household"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "AddHouseHold")]
        void AddHouseHold(HOUSEHOLD household);
        /// <summary>
        /// phunx1, 20150520: luu thong tin vao bang HouseHold va Address
        /// </summary>
        /// <param name="household"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "AddHouseHoldAddress")]
        void AddHouseHoldAddress(BangKe bangKeModel);
        /// <summary>
        /// phunx1, 20150525: method edit thong tin bang ke
        /// </summary>
        /// <param name="bangKeModel"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "EditHouseHoldAddress")]
        void EditHouseHoldAddress(BangKe bangKeModel);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="householdID"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "DeleteHouseHold")]
        void DeleteHouseHold(string householdID);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="customer"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "EditHouseHold")]
        void EditHouseHold(HOUSEHOLD household);
        /// <summary>
        /// phunx1, 20150520: method lay du lieu tu household va address theo household id
        /// </summary>
        /// <param name="houseHoldID"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetHouseHoldAddressByID/{houseHoldID}"
            )]
        BangKe2 GetHouseHoldAddressByID(string houseHoldID);

        #region Service viet cho Data
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "SearchHouseHold")]
         List<HOUSEHOLD2> SearchHouseHold(SearchHouseHold search);
        #endregion

        /// <summary>
        /// nguoi tao: namdt
        /// ngay tao: 12.06.2015
        /// Muc dich: Get list HOUSEHOLD by Area Code
        /// </summary>
        /// <param name="code"></param>
        /// <param name="levels"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByAreaCode/{AreaCode}"
            )]
        List<HOUSEHOLD2> GetByAreaCode(string AreaCode);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByAreaID/{AreaID}"
            )]
        List<PM3_HOUSEHOLD_PRINTCOUNT> GetByAreaID(string AreaID);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetHouseHoldByAreaIDHouseHoldID/{AreaID}/{houseHoldID}"
            )]
        List<PM3_HOUSEHOLD_PRINTCOUNT> GetHouseHoldByAreaIDHouseHoldID(string AreaID, string HouseHoldID);

        /// <summary>
        /// datlq, 20150616: MappingPTDT
        /// </summary>
        /// <param name="customer"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "MappingPTDT")]
        void MappingPTDT(MappingPTDT map);

        /// <summary>
        /// datlq, 20150616: MappingPTDT
        /// </summary>
        /// <param name="customer"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "SetPTDT_Count")]
        List<MappingPTDT> SetPTDT_Count(MappingPTDT map);

        /// <summary>
        /// datlq, 20150625: ChangingPTDT
        /// </summary>
        /// <param name="customer"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "ChangingPTDT")]
        void ChangingPTDT(MappingPTDT map);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "ChangePTDT_Count")]
        List<MappingPTDT> ChangePTDT_Count(MappingPTDT map);


        //Quyvd
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "EditHDC")]
        void EditHDC(DAL.Models.TDT.EditHoDanCu ea);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetEndDate")]
        List<PARAMETER> GetEndDate();
    }
}